Encoder, robot, and printer

ABSTRACT

An encoder includes a base portion, a scale portion that is provided to be relatively rotatable with respect to the base portion, and has a plurality of marks, an imaging element that is disposed in the base portion, and images the marks, and an estimation portion that performs template matching on a captured image in the imaging element by using a reference image, in which the plurality of marks include a first mark and a second mark, and the estimation portion counts the number of pixels of the imaging element corresponding to a rotation angle of the scale portion with respect to the base portion until a position of the second mark is detected from detection of a position of the first mark, and performs calibration on the basis of the counted number of pixels and the rotation angle.

BACKGROUND 1. Technical Field

The present invention relates to an encoder, a robot, and a printer.

2. Related Art

In the related art, calibration in an encoder is performed by separatelyusing a highly accurate encoder for calibration as disclosed inJP-A-2012-237638.

However, separately using the encoder for calibration has a problem thatcalibration takes time, and it is hard to perform highly accuratecalibration.

SUMMARY

An advantage of some aspects of the invention is to provide an encodercapable of performing highly accurate calibration even withoutseparately using an encoder for calibration, and to provide a robot anda printer having the encoder.

The invention can be implemented as the following application examplesor forms.

An encoder according to an application example includes a base portion;a scale portion that is provided to be relatively movable or rotatablewith respect to the base portion, and has a plurality of marks includinga first mark and a second mark; an imaging element that is disposed inthe base portion, and images the marks; and an estimation portion thatperforms template matching on a captured image in the imaging element byusing a reference image, so as to detect positions of the marks, andestimates a movement state or a rotation state of the scale portion withrespect to the base portion, in which the estimation portion counts thenumber of pixels of the imaging element corresponding to a movementamount or a rotation angle of the scale portion with respect to the baseportion until a position of the second mark is detected from detectionof a position of the first mark, and performs calibration on the basisof the counted number of pixels and the movement amount or the rotationangle.

According to the encoder, since the estimation portion counts the numberof pixels of the imaging element corresponding to a movement amount or arotation angle of the scale portion with respect to the base portionuntil a position of the second mark is detected from detection of aposition of the first mark, and performs calibration on the basis of thecounted number of pixels and the movement amount or the rotation angle,it is possible to perform highly accurate calibration even withoutseparately using an encoder for calibration.

In the encoder according to the application example, it is preferablethat the scale portion is relatively rotatable with respect to the baseportion.

With this configuration, it is possible to realize a rotary encoder.

It is preferable that the encoder according to the application examplefurther includes a storage portion that stores an absolute position oran absolute angle of at least one of the first mark and the second markwith respect to the base portion.

With this configuration, it is possible to perform calibration in anabsolute type encoder.

An encoder according to an application example includes a base portion;a scale portion that is provided to be relatively movable or rotatablewith respect to the base portion, and has a plurality of marks includinga first mark; an imaging element that is disposed in the base portion,and images the marks; and an estimation portion that performs templatematching on a captured image in the imaging element by using a referenceimage, so as to detect positions of the marks, and estimates a rotationstate of the scale portion with respect to the base portion, in whichthe estimation portion counts the number of pixels of the imagingelement until a position of the first mark is detected next after thescale portion is rotated by 360° with respect to the base portion fromdetection of a position of the first mark, and performs calibration onthe basis of the counted number of pixels and the rotation angle of360°.

According to the encoder, since the estimation portion counts the numberof pixels of the imaging element corresponding to a movement amount or arotation angle of the scale portion with respect to the base portionuntil a position of the second mark is detected from detection of aposition of the first mark, and performs calibration on the basis of thecounted number of pixels and the movement amount or the rotation angle,it is possible to perform highly accurate calibration even withoutseparately using an encoder for calibration. It is not necessary tomeasure relative positions of the first mark and the second mark inadvance, and it is possible to simplify calibration.

A robot according to an application example includes the encoderaccording to the application example; a first member; and a secondmember that is provided to be rotatable with respect to the firstmember, in which the encoder detects a rotation state of the secondmember with respect to the first member.

According to the robot, the robot can perform a highly accurateoperation by using the encoder performing highly accurate calibration.

It is preferable that the robot according to the application examplefurther includes a decelerator that forwards drive force to the secondmember side from the first member side, in which the scale portion ispreferably connected to the second member.

With this configuration, it is possible to estimate a rotation state ofthe second member with respect to the first member with high accuracycompared with a case of detecting a rotation state of a decelerator onan input shaft side.

A printer according to an application example includes the encoderaccording to the application example.

According to the printer, the printer can perform a highly accurateoperation by using the encoder performing highly accurate calibration.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will be described with reference to the accompanyingdrawings, wherein like numbers reference like elements.

FIG. 1 is a side view illustrating a robot according to a firstembodiment of the invention.

FIG. 2 is a sectional view illustrating an encoder provided in the robotillustrated in FIG. 1.

FIG. 3 is a diagram for explaining a scale portion provided in theencoder illustrated in FIG. 2.

FIG. 4 is a picture illustrating an enlarged dot pattern based on adithering method.

FIG. 5 is a picture illustrating an enlarged dot pattern based on adithering method, in which a density of dots is lower than in the caseillustrated in FIG. 4.

FIG. 6 is a diagram for explaining a captured image obtained by animaging element provided in the encoder illustrated in FIG. 2.

FIG. 7 is a diagram for explaining template matching in a retrievalregion set in the captured image illustrated in FIG. 6.

FIG. 8 is a diagram illustrating a state in which a correlation value isdeviated by one pixel from a state in which the correlation value is themaximum or the minimum during template matching.

FIG. 9 is a diagram illustrating a state in which a correlation value isthe maximum or the minimum during template matching.

FIG. 10 is a diagram illustrating a state in which a correlation valueis deviated by one pixel toward an opposite side to the stateillustrated in FIG. 8 from a state in which the correlation value is themaximum or the minimum during template matching.

FIG. 11 is a diagram for explaining a plurality of marks formed on thescale portion illustrated in FIG. 3.

FIG. 12 is a diagram for explaining detection of a position of a firstmark (starting of counting of the number of pixels).

FIG. 13 is a diagram for explaining detection of a mark subsequent tothe first mark.

FIG. 14 is a diagram for explaining detection of a position of a secondmark (finishing of counting of the number of pixels).

FIG. 15 is a flowchart illustrating a flow of calibration in the encoderillustrated in FIG. 2.

FIG. 16 is a perspective view illustrating a robot according to a secondembodiment of the invention.

FIG. 17 is a diagram illustrating a schematic configuration of a printerof an embodiment of the invention.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

Hereinafter, an encoder, a robot, and a printer according to embodimentsof the invention will be described in detail with reference to theaccompanying drawings.

1. Robot

First Embodiment

FIG. 1 is a side view illustrating a robot of a first embodiment of theinvention. In the following description, for convenience of description,in FIG. 1, an upper part is referred to as an “upper side”, and a lowerpart is referred to as a “lower side”. In FIG. 1, a base side isreferred to as a “basal end”, and an opposite side (end effector side)thereto is referred to as a “distal end”. In FIG. 1, anupward-and-downward direction is referred to as a “vertical direction”,and a leftward-and-rightward direction is referred to as a “horizontaldirection”.

A robot 10 illustrated in FIG. 1, which is a so-called horizontalarticulated robot (scalar robot), is used for a manufacturing process ofmanufacturing, for example, precision equipment, and can perform holdingor transport of the precision equipment or components.

As illustrated in FIG. 1, the robot 10 includes a base 110, a first arm120, a second arm 130, a work head 140, an end effector 150, and awiring routing portion 160. Hereinafter, the respective portions of therobot 10 will be described briefly in order.

The base 110 is fixed to, for example, a floor surface (not illustrated)via bolts or the like. The first arm 120 is connected to an upper end ofthe base 110. The first arm 120 is rotatable about a first axis J1 alongthe vertical direction with respect to the base 110.

The base 110 is provided with a first motor 111 which generates driveforce for rotating the first arm 120, and a first decelerator 112 whichreduces the rotation of the drive force from the first motor 111. Aninput shaft of the first decelerator 112 is connected to a rotationshaft of the first motor 111, and an output shaft of the firstdecelerator 112 is connected to the first arm 120. Thus, if the firstmotor 111 is driven, and a drive force therefrom is forwarded to thefirst arm 120 via the first decelerator 112, the first arm 120 isrotated about the first axis J1 in a horizontal plane with respect tothe base 110.

An encoder 1 which is a first encoder detecting a state of the first arm120 being rotated with respect to the base 110 is provided at the base110 and the first arm 120.

A distal end of the first arm 120 is connected to the second arm 130.The second arm 130 is rotatable about a second axis J2 along thevertical direction with respect to the first arm 120. Although notillustrated, the second arm 130 is provided with a second motor whichgenerates drive force for rotating the second arm 130, and a seconddecelerator which reduces the drive force from the second motor. Thedrive force from the second motor is forwarded to the first arm 120 viathe second decelerator, and thus the second arm 130 is rotated about thesecond axis J2 in a horizontal plane with respect to the first arm 120.Although not illustrated, the second motor is provided with a secondencoder which detects a state of the second arm 130 being rotated withrespect to the first arm 120.

The work head 140 is disposed at a distal end of the second arm 130. Thework head 140 includes a spline shaft 141 inserted into a spline nut anda ball screw nut (none illustrated) which are disposed coaxially at thedistal end of the second arm 130. The spline shaft 141 can be rotatedabout an axis thereof and can be moved up and down in the verticaldirection, with respect to the second arm 130.

Although not illustrated, the second arm 130 is provided with a rotationmotor and a lifting motor. If drive force from the rotation motor isforwarded to the spline nut via a drive force forwarding mechanism (notillustrated), and thus the spline nut is rotated in normal and reversedirections, the spline shaft 141 is rotated in the normal and reversedirections about an axis J3 along the vertical direction. Although notillustrated, the rotation motor is provided with a third encoder whichdetects a state of the spline shaft 141 being rotated with respect tothe second arm 130.

On the other hand, if drive force from the lifting motor is forwarded tothe ball screw nut via a drive force forwarding mechanism (notillustrated), and thus the ball screw nut is rotated in normal andreverse directions, the spline shaft 141 is moved up and down. Thelifting motor is provided with a fourth encoder detecting a movementamount of the spline shaft 141 with respect to the second arm 130.

A distal end (lower end) of the spline shaft 141 is connected to the endeffector 150. The end effector 150 is not particularly limited, and mayemploy, for example, an end effector holding an object to betransported, or an end effector processing an object to be processed.

A plurality of wires connected to the respective electronic components(for example, the second motor, the rotation motor, the lifting motor,and the first to fourth encoders) disposed in the second arm 130 arerouted to the base 110 through the tubular wiring routing portion 160which connects the second arm 130 to the base 110. The plurality ofwires are collected inside the base 110, and are thus routed to acontrol device (not illustrated) which is provided outside the base 110and generally controls the robot 10 along with wires connected to thefirst motor 111 and the encoder 1.

As mentioned above, a configuration of the robot 10 has been describedbriefly. The robot 10 includes the base 110 which is a first member, thefirst arm 120 which is a second member rotatably provided with respectto the base 110, and the encoder 1, and the encoder 1 detects a rotationstate of the first arm 120 with respect to the base 110. As will bedescribed later, according to the robot 10, the robot 10 can perform ahighly accurate operation by using the encoder 1 performing highlyaccurate calibration.

Encoder

Hereinafter, the encoder 1 will be described later in detail.Hereinafter, a description will be made of an example of a case wherethe encoder 1 is incorporated into the robot 10.

FIG. 2 is a sectional view illustrating the encoder provided in therobot illustrated in FIG. 1. FIG. 3 is a diagram for explaining a scaleportion provided in the encoder illustrated in FIG. 2. FIG. 4 is apicture illustrating an enlarged dot pattern based on a ditheringmethod. FIG. 5 is a picture illustrating an enlarged dot pattern basedon a dithering method, in which a density of dots is lower than in thecase illustrated in FIG. 4. In each drawing excluding FIGS. 4 and 5, forconvenience of description, a scale of each unit is changed asappropriate, and an illustrated configuration does not necessarily matchan actual scale, and illustration of each unit is simplified asappropriate.

As illustrated in FIG. 2, the base 110 of the robot 10 includes asupport member 114 supporting the first motor 111 and the firstdecelerator 112, and stores the first motor 111 and the firstdecelerator 112 therein. The base 110 is provided with the first arm 120which is rotatable about the first axis J1.

The first arm 120 includes an arm main body portion 121 which extendsalong the horizontal direction, and a shaft portion 122 which protrudesdownward from the arm main body portion 121, and the two portions areconnected to each other. The shaft portion 122 is supported at the base110 via a bearing 115 so as to be rotatable about the first axis J1, andis also connected to the output shaft of the first decelerator 112. Theinput shaft of the first decelerator 112 is connected to a rotationshaft 1111 of the first motor 111.

Here, the base 110 is a structural body to which a load based on thedead weight of the base 110 or the mass of other elements supported bythe base 110 is applied. Similarly, the first arm 120 is also astructural body to which a load based on the dead weight of the firstarm 120 or the mass of other elements supported by the first arm 120 isapplied. Materials forming the base 110 and the first arm 120 are notparticularly limited, and may employ, for example, metal materials.

In the present embodiment, outer surfaces of the base 110 and the firstarm 120 form a part of an outer surface of the robot 10. Exteriormembers such as a cover and an impact absorbing material may be attachedto the outer surfaces of the base 110 and the first arm 120.

The relatively rotated base 110 and first arm 120 are provided with theencoder 1 detecting rotation states thereof.

The encoder 1 includes a scale portion 2 provided at the first arm 120,a detection portion 3 provided at the base 110 and detecting the scaleportion 2, an estimation portion 5 estimating relative rotation statesof the base 110 and the first arm 120 on the basis of a detection resultin the detection portion 3, and a storage portion 6 which iselectrically connected to the estimation portion 5.

The scale portion 2 is provided at a portion of the arm main bodyportion 121 facing the base 110, that is, a portion surrounding theshaft portion 122 on a lower surface of the arm main body portion 121.As illustrated in FIG. 3, the scale portion 2 has irregular patternsdisposed along the first axis J1 at positions which are different fromthe first axis J1. Here, the scale portion 2 is provided on the surfaceof the first arm 120. Consequently, a member for providing the scaleportion 2 is not required to be provided separately from the base 110and the first arm 120. Thus, it is possible to reduce the number ofcomponents. The scale portion 2 is not limited to a case of beingdirectly provided on the surface of the first arm 120, and may beprovided on a sheet member adhered to the surface of the first arm 120,and may be provided on a tabular member which is provided to be rotatedalong with the first arm 120. In other words, a member (rotationportion) provided with the scale portion 2 may be a member which isrotated about the first axis J1 along with the first arm 120 withrespect to the base 110.

As illustrated in FIG. 3, the scale portion 2 (irregular pattern) isconfigured such that a plurality of dots 20 (pattern) which can beimaged by an imaging element 31 are irregularly disposed. Here, the“irregular pattern” indicates that, in a case where the scale portion 2is rotated over a necessary angle range (in the present embodiment, anangle range in which the first arm 120 can be rotated with respect tothe base 110) about the first axis J1, an identical pattern (a patternwhich cannot be identified by the estimation portion 5) does not appeartwice or more with a size corresponding to a reference image TA whichwill be described later in a predetermined region (for example, aneffective visual field region RU or a retrieval region RS which will bedescribed later) within a captured image G which will be described laterand which is imaged by the imaging element 31. Thus, each of a pluralityof portions at different positions of the scale portion 2 can be used asa mark 21 for identifying a position of the scale portion 2 in acircumferential direction. As mentioned above, the scale portion 2 canbe said to have a plurality of marks 21 for identifying differentpositions of the scale portion 2 in the circumferential direction. FIG.3 illustrates a case where the plurality of marks 21 are arranged alonga circumference centering on the first axis J1. Positions, sizes, andthe number of marks 21 illustrated in FIG. 3 are only examples, and arenot limited thereto.

The scale portion 2 (pattern) may be formed by using, for example, anink jet printer (an example of a printing apparatus). In this case, agrayscale image which is processed by using a dithering method is outputby using an FM screening method which is a method of expressinggradations or grayscales by adjusting a density of the dots 20, and thusthe patterns as illustrated in FIG. 4 or 5 are obtained and may be usedfor the scale portion 2. FIG. 4 illustrates an example of a pattern in acase where a plurality of dots 20 are relatively densely disposed. FIG.5 illustrates an example of a pattern in a case where a plurality ofdots 20 are relatively roughly disposed. In order to obtain such apattern, an FM screening method may be used alone, and a method (aso-called hybrid screening method) of combining the FM screening methodwith other methods (for example, an AM screening method which is amethod of expressing gradations or grayscales by adjusting a size of adot) may be used.

Since the patterns of the scale portion 2 are consecutively disposedaround the first axis J1, there is less restriction in a position in arotation direction (circumferential direction) and the degree of freedomis increased when the estimation portion 5 which will be described latergenerates a reference image (template). Since the patterns of the scaleportion 2 are disposed outside the effective visual field region RU ofthe captured image G in the Y axis direction, a reference image(template) can be generated even if positioning of the scale portion 2(pattern) for the first arm 120 is not performed with high accuracy, andthus a rotation state can be estimated.

The scale portion 2 may have a gradation which gradually changes alongthe circumferential direction. In other words, a density (dispositiondensity) of the plurality of dots 20 may change along the periphery ofthe first axis J1 (rotation axis). A color of the dot 20 (pattern) ofthe scale portion 2 is not particularly limited, and may be any color,but is preferably different from colors of portions other than the dots20 of the scale portion 2, and is more preferably black or a dark color.Consequently, a contrast of a captured image obtained by the imagingelement 31 can be increased, and, as a result, detection accuracy can beimproved.

A shape of the dot 20 (pattern) of the scale portion 2 is illustrated tobe a circular shape, but is not limited thereto, and may be, forexample, an elliptical shape, a quadrilateral shape, or a deformedshape. The patterns of the scale portion 2 are not limited to dotpatterns (repetition of a pattern) such as patterns formed of theplurality of dots 20, and may be, for example, patterns formed of linearlines, patterns formed of curved lines, patterns formed of a combinationof at least two of dots, linear lines, and curved lines, or inversepatterns thereof.

The patterns of the scale portion 2 are not limited to patterns formedwith ink such as dyes or pigments by using the above-described printingapparatus as long as the patterns can be imaged by the imaging element31, and may be, for example, patterns based on an irregular shape, orpatterns formed on a natural object. The patterns based on an irregularshape may be, for example, irregularities based on roughness orunevenness of a processing surface using etching, cutting, shotblasting, sand blasting, or filing, irregularities using fibers on asurface of paper, a cloth (a nonwoven fabric or a woven fabric), or thelike, or irregularities of a coating film surface. The patterns formedon a natural object may be, for example, wood grains. For example, acoating film is formed by using transparent paint with which black beadsare mixed, a coating film in which a plurality of black beads areirregularly disposed can be obtained, and the plurality of beads of thecoating film may be used for the scale portion 2 as irregular patterns.

The marks 21 of the scale portion 2 are not limited to the illustratedirregular patterns, may use numbers, and may use letters such as romanletters, Arabic letters, and Chinese letters, and may use, for example,symbols, signs, tokens, emblems, designs, or a one-dimensional barcodeor a QR code (registered trademark) other than letters.

The detection portion 3 illustrated in FIG. 2 includes the imagingelement 31 provided in the base 110, and an optical system 32 providedin an opening of the base 110. The imaging element 31 images a part (animaging region RI illustrated in FIG. 3) of the scale portion 2 in thecircumferential direction of the scale portion 2 via the optical system32. A light source which illuminates the imaging region RI of theimaging element 31 may be provided as necessary.

As the imaging element 31, for example, a charge coupled device (CCD) ora complementary metal oxide semiconductor (CMOS) may be used. Theimaging element 31 converts a captured image into an electric signal foreach pixel so as to output the electric signal. The imaging element 31may employ a two-dimensional imaging element (area image sensor) or aone-dimensional imaging element (line image sensor). The one-dimensionalimaging element is preferably disposed in a direction in whicharrangement of pixels is in contact with a turning circle of the arm. Ina case where the two-dimensional imaging element is used, atwo-dimensional image having a large amount of information can beacquired, and thus it becomes easier to increase the detection accuracyof the marks 21 using template matching which will be described later.As a result, it is possible to detect a rotation state of the first arm120 with high accuracy. In a case where the one-dimensional imagingelement is used, since an image acquisition cycle, that is, a so-calledframe rate is high, it is possible to increase a detection frequency,and thus this is advantage in terms of a high speed operation.

The optical system 32 is an image forming optical system disposedbetween the scale portion 2 and the imaging element 31. The opticalsystem 32 preferably has a telecentric object side (the scale portion 2side). Consequently, even if a distance between the scale portion 2 andthe imaging element 31 varies, a change in an image formingmagnification toward the imaging element 31 can be reduced, and, as aresult, it is possible to minimize deterioration in detection accuracyin the encoder 1. Particularly, in a case where the optical system 32 isof a bitelecentric type, even if a distance between a lens of theoptical system 32 and the imaging element 31 varies, a change in animage forming magnification toward the imaging element 31 can bereduced. Thus, there is an advantage in which assembling of the opticalsystem 32 is facilitated.

Here, as illustrated in FIG. 3, the imaging region RI of the imagingelement 31 is set to overlap a part of the scale portion 2 in thecircumferential direction on the lower surface of the first arm 120.Consequently, the imaging element 31 can image the mark 21 located inthe imaging region RI. Therefore, the mark 21 located in the imagingregion RI is read, and thus a rotation state of the first arm 120 can beunderstood.

The estimation portion 5 illustrated in FIG. 2 estimates relativerotation states of the base 110 and the first arm 120 on the basis of adetection result in the detection portion 3. The rotation states mayinclude, for example, a rotation angle, a rotation speed, and a rotationdirection.

Particularly, the estimation portion 5 includes an image recognitioncircuit 51 which performs image recognition on the marks 21 byperforming template matching on a captured image (captured image data)in the imaging element 31 by using a reference image (reference imagedata), and estimates relative rotation states of the base 110 and thefirst arm 120 by using a recognition result in the image recognitioncircuit 51.

Here, the estimation portion 5 is configured to be able to more finelyestimate a relative rotation angle (hereinafter, also simply referred toas a “rotation angle of the first arm 120”) of the base 110 and thefirst arm 120 on the basis of a position of an image of the mark 21 in acaptured image obtained by the imaging element 31. The estimationportion 5 is configured to be able to obtain a rotation speed on thebasis of a time interval at which the marks 21 are detected, or toestimate a rotation direction on the basis of an order of the types ofdetected marks 21. The estimation portion 5 outputs a signalcorresponding to the above-described estimation result, that is, asignal corresponding to a rotation state of the base 110 and the firstarm 120. The signal is input to, for example, a control device (notillustrated), and is used to control an operation of the robot 10.

The estimation portion 5 has a function of cutting out apart of thecaptured image obtained by the imaging element 31, so as to generate areference image (template). The generation of a reference image isperformed for each relative rotation state before estimating a relativerotation state of the base 110 and the first arm 120 or at anappropriate time as necessary. The generated reference image is storedin the storage portion 6 in correlation with each relative rotationstate of the base 110 and the first arm 120. The estimation portion 5performs template matching by using the reference image (template)stored in the storage portion 6. Template matching and an estimation ofa rotation state using the template matching will be described later indetail.

The estimation portion 5 may be configured by using, for example, anapplication specific integrated circuit (ASIC) or a field programmablegate array (FPGA). As mentioned above, the estimation portion 5 isformed of hardware by using the ASIC or the FPGA, and thus it ispossible to achieve a high processing speed, miniaturization, and lowcost of the estimation portion 5. The estimation portion 5 may beconfigured to include, for example, a processor such as a centralprocessing unit (CPU) and a memory such as a read only memory (ROM) or arandom access memory (RAM). In this case, the processor executes aprogram stored in the memory as appropriate, and thus theabove-described functions can be realized. At least a part of theestimation portion 5 may be incorporated into the control device.

Here, the storage portion 6 stores the reference image (reference imagedata) along with information regarding a coordinate (a coordinate of areference pixel which will be described later) corresponding to thereference image, and information (angle information) regarding arotation angle of the first arm 120, for each relative rotation state ofthe base 110 and the first arm 120. As the storage portion 6, anonvolatile memory and a volatile memory may be used, but thenonvolatile memory is preferably used from the viewpoint that a state ofstoring information can be held even if power is not supplied, and powercan be saved. The storage portion 6 may be integrally configured withthe estimation portion 5.

Template Matching and Estimation of Rotation State Using TemplateMatching

Hereinafter, a detailed description will be made of template matchingand an estimation of a rotation state using template matching in theestimation portion 5. Hereinafter, as an example, a description will bemade of a case where a rotation angle is estimated as a rotation state.

Acquisition of Reference Image

In the encoder 1, a reference image used for template matching isacquired before a rotation state of the first arm 120 with respect tothe base 110 is estimated by using template matching. The acquisition ofa reference image may be performed only once before initial templatematching, but may be performed at an appropriate timing as necessarythereafter. In this case, a reference image used for template matchingmay be updated to an acquired new reference image.

When a reference image is acquired, the first arm 120 is rotated aboutthe first axis J1 with respect to the base 110 as appropriate, and animage of each mark 21 is captured by the imaging element 31 for theplurality of marks 21. Each obtained captured image is trimmed, and thusa reference image of each mark 21 is generated. The generated referenceimage is stored in the storage portion 6 along with and in correlationwith pixel coordinate information and angle information. Hereinafter,this will be described in detail with reference to FIG. 6.

FIG. 6 is a diagram for explaining a captured image obtained by theimaging element provided in the encoder illustrated in FIG. 2.

In a case where the first arm 120 is rotated about the first axis withrespect to the base 110, for example, as illustrated in FIG. 6, a markimage 21A which is an image of the mark 21 reflected in the capturedimage G in the imaging element 31 is moved along circular arcs C1 and C2in the captured image G. Here, the circular arc C1 is a trajectory drawnby a lower end of the mark image 21A in FIG. 6 due to rotation of thefirst arm 120 with respect to the base 110, and the circular arc C2 is atrajectory drawn by an upper end of the mark image 21A in FIG. 6 due torotation of the first arm 120 with respect to the base 110. FIG. 6illustrates a case where three marks 21 are included in the imagingregion RI illustrated in FIG. 3, and, in correspondence thereto, thecaptured image G illustrated in FIG. 8 includes not only the mark image21A but also a mark image 21B located on one side in the circumferentialdirection with respect to the mark image 21A and a mark image 21Xlocated on the other side.

Here, the captured image G obtained through imaging in the imagingelement 31 has a shape corresponding to the imaging region RI, and has arectangular shape having two sides extending in an X axis direction andtwo sides extending in a Y axis direction. The two sides of the capturedimage G in the X axis direction are disposed along the circular arcs C1and C2 as much as possible. The captured image G has a plurality ofpixels arranged in a matrix form in the X axis direction and the Y axisdirection. Here, a position of a pixel is expressed by a pixelcoordinate system (X,Y) indicated by “X” indicating a position of thepixel in the X axis direction and “Y” indicating a position of the pixelin the Y axis direction. A central region excluding an outer peripheryof the captured image G is set as an effective visual field region RU,and a pixel at an upper left end of the figure in the effective visualfield region RU is set as an origin pixel (0,0) of the pixel coordinatesystem (X,Y).

In a case where a reference image TA corresponding to the mark image 21Ais generated, the first arm 120 is rotated with respect to the base 110as appropriate, and the mark image 21A is located at a predeterminedposition (in FIG. 6, on a central line LY set at the center in the Xaxis direction) in the effective visual field region RU. Here, arotation angle θA0 of the first arm 120 with respect to the base 110when the mark image 21A is located at the predetermined position isacquired in advance through measurement or the like.

The captured image G is trimmed in a rectangular pixel range as arequired minimum range including the mark image 21A, and thus thereference image TA (a template for detection of the mark 21) isobtained. The obtained reference image TA is stored in the storageportion 6. In this case, the reference image TA is stored along with andin correlation with angle information regarding the rotation angle ΔA0,and pixel information regarding a reference pixel coordinate (XA0,YA0)which is a pixel coordinate of a reference pixel (in FIG. 6, the pixelat the upper left end) in the pixel range of the reference image TA. Inother words, the reference image TA, the angle information, and thepixel coordinate information are a single template set used for templatematching. Here, in a case where the encoder 1 is of an absolute type,angle information in this template set is an absolute angle. In a casewhere the encoder 1 is of an incremental type, angle information in thistemplate set is a relative angle. The angle information and the pixelcoordinate information in the template set may be adjusted throughcalibration which will be described later.

Estimation of Rotation State Using Template Matching

Next, with reference to FIGS. 7 to 10, a description will be made oftemplate matching using the reference image TA generated as describedabove.

FIG. 7 is a diagram for explaining template matching in a retrievalregion set in the captured image illustrated in FIG. 6. FIG. 8 is adiagram illustrating a state in which a correlation value is deviated byone pixel from a state in which the correlation value is the maximum orthe minimum during template matching. FIG. 9 is a diagram illustrating astate in which a correlation value is the maximum or the minimum duringtemplate matching. FIG. 10 is a diagram illustrating a state in which acorrelation value is deviated by one pixel toward an opposite side tothe state illustrated in FIG. 8 from a state in which the correlationvalue is the maximum or the minimum during template matching.

As illustrated in FIG. 7, when the mark image 21A is present in theeffective visual field region RU, template matching is performed on animage of the effective visual field region RU by using the referenceimage TA. In the present embodiment, the entire effective visual fieldregion RU is set as a retrieval region RS, the reference image TAoverlaps the retrieval region RS, and a correlation value of anoverlapping portion between the retrieval region RS and the referenceimage TA is calculated while deviating the reference image TA by onepixel with respect to the retrieval region RS. Here, a pixel coordinateof the reference pixel of the reference image TA is moved by one pixelfrom a start coordinate PS (origin pixel P0) to an end pixel PE, and acorrelation value of an overlapping portion between the retrieval regionRS and the reference image TA is calculated for each pixel coordinate ofthe reference pixel of the reference image TA with respect to the pixelsof the entire retrieval region RS. The calculated correlation value isstored in the storage portion 6 in correlation with the pixel coordinateof the reference pixel of the reference image TA as correlation valuedata between captured image data and reference image data.

The maximum correlation value is selected from among the plurality ofcorrelation values for each of the pixel coordinates stored in thestorage portion 6, and a pixel coordinate (XA1,YA1) of the referenceimage TA having the selected correlation value is determined as a pixelcoordinate of the mark image 21A. In the above-described way, it ispossible to detect a position of the mark image 21A in the capturedimage G.

Here, a subpixel estimation method is preferably used to obtain a pixelcoordinate of the mark image 21A. As illustrated in FIGS. 8 to 10, thereference image TA overlaps the mark image 21A in the vicinity of themaximum correlation value. In the state illustrated in FIG. 9, acorrelation value is greater than in the states (states of beingdeviated by one pixel from the state illustrated in FIG. 9) illustratedin FIGS. 8 and 10, and the correlation value is greatest. However, as inthe state illustrated in FIG. 9, in a case where the reference image TAdoes not completely match the mark image 21A, and overlaps the markimage 21A so as to be deviated therefrom, if it is determined that thestate illustrated in FIG. 9 is a pixel position of the mark image 21A, adifference therebetween is an error. The difference is a visual fieldsize BX to the maximum. In other words, in a case where the subpixelestimation method is not used, the visual field size BX is the minimumresolution (accuracy). In contrast, if the subpixel estimation method isused, a correlation value for each visual field size BX can be fittedwith a parabola (an equal-angle line may also be used), and thus such aninter-correlation value (inter-pixel pitch) can be complemented(approximated). Thus, it is possible to obtain a pixel coordinate of themark image 21A with higher accuracy. In the above description, as anexample, a description has been made of a case where a pixel coordinateat which a correlation value is the maximum is used for a pixel positionof the mark image 21A, but template matching may be performed such thata pixel coordinate at which a correlation value is the minimum is usedfor a pixel position of the mark image 21A.

As mentioned above, the estimation portion 5 sets the retrieval regionRS in the effective visual field region RU which is a partial region ofthe captured image G, and template matching is performed within theretrieval region RS. Consequently, the number of pixels of the retrievalregion RS used for template matching can be reduced, and thus acalculation time related to the template matching can be reduced. Thus,even in a case where angular velocity of the first arm 120 about thefirst axis J1 is high, it is possible to perform highly accuratedetection. Even if distortion or blurring of the outer peripheralportion of the captured image G increases due to aberration of theoptical system 32 disposed between the imaging element 31 and the marks21, a region in which such distortion or blurring is small is used asthe retrieval region RS, and thus it is possible to minimizedeterioration in the detection accuracy. Generation of the referenceimage TA and template matching may be performed by using the entireregion of the captured image G, and, in this case, correction ispreferably performed by taking into consideration aberration asnecessary.

In the present embodiment, since a distance between the imaging regionRI and the first axis J1 is sufficiently long, each of the circular arcsC1 and C2 can be approximated to a substantially straight line in thecaptured image G. Therefore, a movement direction of the mark image 21Ain the captured image G may be considered to match the X axis direction.

Therefore, the mark image 21A illustrated in FIG. 7 is located at aposition deviated by the number of pixels (XA1-XA0) in the X axisdirection with respect to the reference image TA located at thereference pixel coordinate (XA0, YA0). Therefore, in a case where adistance between the center of the imaging region RI and the first axisJ1 is indicated by r, and a width (a visual field size per pixel of theimaging element 31) of a region on the imaging region RI in the X axisdirection, corresponding to one pixel of the imaging element 31 isindicated by W, a rotation angle θ of the first arm 120 with respect tothe base 110 may be obtained by using Equation (1) as follows.

$\begin{matrix}{\theta = {{\theta\; A\; 0} + {\frac{\left( {{X\; A\; 1} - {X\; A\; 0}} \right) \times W}{2\; r\;\pi} \times {360\lbrack{^\circ}\rbrack}}}} & (1)\end{matrix}$

In Equation (1), (XA1−XA0)×W corresponds to a distance between an actualposition corresponding to the reference pixel coordinate (XA0,YA0) ofthe reference image TA and an actual position corresponding to the pixelcoordinate (XA1,YA1) of the reference image TA at which theabove-described correlation value is the maximum. 2rπ corresponds to alength of a trajectory of the mark 21 (a length of a circumference) whenthe first arm 120 is rotated by 360° with respect to the base 110. ΔA0indicates a rotation angle of the first arm 120 with respect to the base110 when the mark image 21A is located at a predetermined position asdescribed above. The rotation angle θ is an angle by which the first arm120 is rotated from a reference state (0°) with respect to the base 110.

The above-described template matching and calculation of the rotationangle θ using the template matching are also performed on other marks 21in the same manner. Here, a reference image corresponding to each mark21 is registered such that at least one of the marks 21 is reflectedwithout being omitted in the effective visual field region RU, andtemplate matching can be performed, with respect to any rotation angleθ. Consequently, it is possible to prevent the occurrence of an anglerange in which template matching cannot be performed.

In FIG. 6 described above, the marks 21 and the effective visual fieldregion RU are configured such that a single mark 21 is reflected withoutbeing omitted in the effective visual field region RU with respect toany rotation angle θ, but the marks 21 and the effective visual fieldregion RU are preferably configured such that a plurality of marks 21are reflected without being omitted in the effective visual field regionRU with respect to any rotation angle θ. In this case, template matchingis performed by using two or more reference images corresponding to twoor more marks 21 adjacent to each other such that the template matchingcan be performed on the plurality of marks 21 reflected in the effectivevisual field region RU with respect to any rotation angle θ. In thiscase, the two or more reference images may partially overlap each other.

In other words, the imaging element 31 preferably images all of at leasttwo marks 21 among the plurality of marks 21 which are targets oftemplate matching. Consequently, even if one of the two marks 21 imagedby the imaging element 31 cannot be accurately read due to contaminationor the like, the other mark 21 can be read, and thus detection can beperformed. Thus, there is an advantage in which it becomes easier toensure high detection accuracy. As mentioned above, the estimationportion 5 preferably performs template matching by simultaneously usinga plurality of reference images with respect to the retrieval region RS.Consequently, it is possible to increase detection accuracy. Templatematching using a plurality of reference images will be described indetail in a second embodiment.

Calibration

FIG. 11 is a diagram for explaining a plurality of marks included in thescale portion illustrated in FIG. 3. FIG. 12 is a diagram for explaininga detection of a position of a first mark (starting of counting of thenumber of pixels). FIG. 13 is a diagram for explaining detection of amark subsequent to the first mark. FIG. 14 is a diagram for explainingdetection of a position of a second mark (finishing of counting of thenumber of pixels). In FIG. 11, the patterns of the scale portion 2 areillustrated, but, for convenience of description, the patterns of thescale portion 2 are not illustrated in FIGS. 12 to 14. In FIGS. 12 to14, marks other than marks required in description are not illustrated.

As illustrated in FIG. 11, a plurality of marks 21 are set on the scaleportion 2 in the rotation direction. FIG. 11 illustrates a state inwhich five marks 21 i−2 to 21 i+2 from (i−2)-th to (i+2)-th arereflected in the captured image G. Here, i is a number attached to eachof the mark 21 in an arrangement order thereof, and is an integer of 1or more and n or less in a case where the number of marks 21 set on thescale portion 2 is n (where n is an integer of 3 or more).

As described above, the estimation portion 5 detects a position of themark 21 reflected in the retrieval region RS through template matching,so as to obtain a relative or absolute rotation angle of the first arm120 (a rotation angle of the scale portion 2) with respect to the base110. In this case, the estimation portion 5 uses a reference imagestored in the storage portion 6 along with angle information and pixelcoordinate information.

Here, in a case where the angle information stored in the storageportion 6 is deviated from an actual relative angle or absolute angle,detection accuracy in the encoder 1 is reduced. Therefore, calibrationdescribed below is performed. Hereinafter, a description will be made ofa case where the mark 21 is moved from the right side in the figuretoward the left side inside the retrieval region RS. Calibration may besimilarly performed in a case where the mark 21 is moved from the leftside in the figure toward the right side inside the retrieval region RS.Calibration may be performed at any timing, but may be performed duringa final process of manufacturing of the encoder 1 or the robot 10, orduring an operation of the encoder 1.

In the calibration, first, as illustrated in FIG. 12, the mark 21 i(first mark) is located at a reference position X0 through an operationof a user. The reference position X0 may be any position in theretrieval region RS, but is set on a right portion (that is, a movementdirection upstream side of the mark 21) in the retrieval region RS inFIG. 12. In the present embodiment, in a case where a single mark 21 islocated at the reference position X0, another mark 21 is located in theretrieval region RS on a movement direction downstream side (the leftside in FIG. 12) of the mark 21 with respect to the reference positionX0.

The scale portion 2 is rotated through an operation or the like of theuser. Here, in a case where the scale portion 2 is rotated, the mark 21i is moved in the rotation direction (from the right side to the leftside in FIG. 12) of the scale portion 2 in the retrieval region RS dueto the rotation. In this case, the estimation portion 5 causes thereference image i to track the movement of the mark 21 i, and alsodetects positions of the mark 21 i in order by performing templatematching. The estimation portion 5 counts the number of pixels of thereference image i which is moved in tracking of the movement of the mark21 i (counts the number of pixels P from the reference position X0 to aposition X1).

As illustrated in FIG. 13, in a case where the mark 21 i+1 reaches thereference position X0, the estimation portion 5 performs templatematching while causing the reference image i+1 to track movement of themark 21 i+1, and counts the number of pixels of the reference image i+1which is moved in tracking of the movement of the mark 21 i+1. Suchcounting of the number of pixels is also performed in the same mannerfor the mark 21 i+2 and the subsequent marks. When the mark 21 i+1reaches the reference position X0, the mark 21 i is located at theposition X1.

As illustrated in FIG. 14, in a case where the mark 21 i reaches thereference position X0, the estimation portion 5 stops counting thenumber of pixels. Consequently, it is possible to count the number ofpixels (a total of the number of pixels P from the reference position X0to the position X1 for each of the marks 21) of the imaging element 31corresponding to a movement amount (rotation angle) of the mark 21 whenthe scale portion 2 is rotated by 360°. It is possible to obtain arotation angle per pixel of the first arm 120 (or the scale portion 2)with respect to the base 110 on the basis of the counted number and themovement amount (that is, 360°) of the mark 21. It is possible toperform calibration by adjusting relative angle information of eachreference image by using the rotation angle per pixel. Here, in a casewhere an absolute rotation angle of the first arm 120 (a rotation angleof the scale portion 2) with respect to the base 110 when the mark 21 iis located at the reference position X0 is known, it is possible toperform calibration by adjusting absolute angle information of eachreference image.

Hereinafter, with reference to FIG. 15, a description will be made of aflow of calibration in the encoder 1.

FIG. 15 is a flowchart illustrating a flow of calibration in the encoderillustrated in FIG. 2.

First, the estimation portion 5 determines whether or not a first markwhich is any mark 21 among a plurality of marks 21 is located at thereference position X0 (step S11). The estimation portion 5 repeatedlyperforms step S11 until the first mark is located at the referenceposition X0 (NO in step S11). In a case where the first mark is locatedat the reference position X0 (YES in step S11), the estimation portion 5sets the first mark to the mark 21 i (step S12), and starts to count thenumber of pixels as described above (step S13).

Next, the estimation portion 5 determines whether or not the mark 21 i+1(the mark 21 subsequent to the first mark) reaches the referenceposition X0 (step S14). The estimation portion 5 repeatedly performsstep S14 until the mark 21 i+1 is located at the reference position X0(NO in step S14). In a case where the mark 21 i+1 is located at thereference position X0 (YES in step S14), the estimation portion 5 storesa counted value of the number of pixels in the storage portion 6 (stepS15). In this case, the counted value is stored in the storage portion 6along with the mark 21 i or identification information of the referenceimage i corresponding thereto.

Next, the estimation portion 5 determines whether or not a second mark(in the present embodiment, the mark 21 which is the same as the firstmark) which is any mark 21 among a plurality of marks 21 reaches thereference position X0 (step S16). In a case where the second mark is notlocated at the reference position X0 (NO in step S16), the estimationportion 5 sets i+1 as i (step S17), and proceeds to step S14 describedabove. Consequently, the estimation portion 5 counts the number ofpixels until the second mark is located at the reference position X0,and stores a counted value thereof in the storage portion 6.

On the other hand, in a case where the second mark reaches the referenceposition X0 (YES in step S16), the estimation portion 5 finishescounting the number of pixels (step S18). The estimation portion 5calculates a movement amount (rotation angle) per pixel (step S19).Thereafter, angle information of the reference image is adjusted byusing the calculated movement amount (rotation angle) per pixel (stepS20), and the calibration is finished.

As described above, the encoder 1 includes the base 110 which is a baseportion, the scale portion 2 which is provided to be relativelyrotatable with respect to the base 110 and has a plurality of marks 21,the imaging element 31 which is disposed in the base 110 and images themarks 21, and the estimation portion 5 which performs template matchingon the captured image G in the imaging element 31 by using a referenceimage, so as to detect positions of the marks 21, and estimates arotation state of the scale portion 2 with respect to the base 110. Theplurality of marks 21 include a first mark and a second mark, and theestimation portion 5 counts the number of pixels of the imaging element31 corresponding to a rotation angle of the scale portion 2 with respectto the base 110 until a position of the second mark is detected fromdetection of a position of the first mark, and performs calibration onthe basis of the counted number of pixels and the rotation angle.

According to the encoder 1, since the estimation portion 5 counts thenumber of pixels of the imaging element 31 corresponding to a rotationangle of the scale portion 2 with respect to the base 110 until aposition of the second mark is detected from detection of a position ofthe first mark, and performs calibration on the basis of the countednumber of pixels and the rotation angle, it is possible to performhighly accurate calibration even without separately using an encoder forcalibration.

Here, the estimation portion 5 counts the number of pixels of theimaging element 31 until a position of the first mark is detected nextafter the scale portion 2 is rotated by 360° with respect to the baseportion 110 from detection of the position of the first mark, andperforms calibration on the basis of the counted number of pixels andthe rotation angle of 360°. Therefore, it is not necessary to measurerelative positions of the first mark and the second mark in advance, andit is possible to simplify calibration. In a case where the first markand the second mark are different from each other, relative positions(for example, angles) of the marks are required to be known.

The encoder 1 includes the storage portion 6 which stores an absoluteposition or an absolute angle of at least one of the first mark and thesecond mark with respect to the base 110 (base portion). Consequently,it is possible to perform calibration in the encoder 1 which is anabsolute type encoder.

In the present embodiment, the scale portion 2 is relatively rotatablewith respect to the base 110 (base portion). Consequently, it ispossible to realize the encoder 1 which is a rotary encoder.

Here, the robot 10 includes the first decelerator 112 which is adecelerator delivering drive force to the first arm 120 (second member)from the base 110 (first member) side, and the scale portion 2 isconnected to the first arm 120. Consequently, it is possible to estimatea rotation state of the first arm 120 with respect to the base 110 withhigh accuracy compared with a case of detecting a rotation state of thefirst decelerator 112 on the input shaft side.

Second Embodiment

FIG. 16 is a perspective view illustrating a robot according to a secondembodiment of the invention. Hereinafter, a base 210 side of a robot 10Cwill be referred to as a “basal end side”, and an end effector side willbe referred to as a “distal end side”.

Hereinafter, the second embodiment will be described focusing on adifference from the above-described embodiments, and a description ofthe same content will be omitted.

The robot 10C illustrated in FIG. 16 is a vertical articulated(six-axis) robot. The robot 10C has the base 210 and a robot arm 200,and the robot arm 200 includes a first arm 220, a second arm 230, athird arm 240, a fourth arm 250, a fifth arm 260, and a sixth arm 270,and these arms are connected to each other in this order toward thedistal end side from the basal end side. For example, an end effectorsuch as a hand holding precision equipment or components is attachablyand detachably attached to a distal end of the sixth arm 270. Althoughnot illustrated, the robot 10C includes a robot control device (controlunit) such as a personal computer (PC) controlling an operation of eachportion of the robot 10C.

Here, the base 210 is fixed to, for example, a floor, a wall, or aceiling. The first arm 220 is rotatable about a first rotation axis O1with respect to the base 210. The second arm 230 is rotatable about asecond rotation axis O2 which is orthogonal to the first rotation axisO1 with respect to the first arm 220. The third arm 240 is rotatableabout a third rotation axis O3 which is parallel to the second rotationaxis O2 with respect to the second arm 230. The fourth arm 250 isrotatable about a fourth rotation axis O4 which is orthogonal to thethird rotation axis O3 with respect to the third arm 240. The fifth arm260 is rotatable about a fifth rotation axis O5 which is orthogonal tothe fourth rotation axis O4 with respect to the fourth arm 250. Thesixth arm 270 is rotatable about the sixth rotation axis O6 which isorthogonal to the fifth rotation axis O5 with respect to the fifth arm260. With respect to the first rotation axis O1 to the sixth rotationaxis O6, the term “orthogonal” also includes a case where an angleformed between two axes is deviated from 90° within a range of ±5°, andthe term “parallel” also includes a case where one of two axes isinclined with respect to the other within a range of ±5°.

Although not illustrated, each connection portion (joint) of the base210 and the first arm 220 to the sixth arm 270 is provided with a drivesource including a motor and a decelerator. Here, a drive source whichrotates the first arm 220 with respect to the base 210 is provided withthe encoder 1. A detection result in the encoder 1 is input to, forexample, the robot control device (not illustrated), and is used tocontrol driving of the drive source which rotates the first arm 220 withrespect to the base 210. Although not illustrated, encoders are providedin other joints, and the encoder 1 may be used as the encoders.

As mentioned above, the robot 10C includes the base 210 which is a firstmember, and the first arm 220 which is a second member provided to berotatable with respect to the base 210, and the encoder 1 of the firstembodiment or the second embodiment, and the encoder 1 detects arotation state of the first arm 220 with respect to the base 210.According to the robot 10C, detection accuracy in the encoder 1 is high,and thus it is possible to control an operation of the robot 10C withhigh accuracy by using a detection result in the encoder 1.

In the above description, a description has been made of a case wherethe encoder 1 detects a rotation state of the first arm 220 with respectto the base 210, but the encoder 1 may be provided in another joint soas to detect a rotation state of another arm. In this case, an arm onone side with respect to the joint may be regarded as a first member,and an arm on the other side may be regarded as a second member.

2. Printer

FIG. 17 is a diagram illustrating a schematic configuration of a printerof an embodiment of the invention.

A printer 1000 illustrated in FIG. 17 is a label printing deviceincluding a drum-shaped platen. In the printer 1000, a single sheet S(web) such as a paper type or a film type as a recording medium of whichboth ends are wound on a delivery shaft 1120 and a winding shaft 1140 ina roll form is hung between the delivery shaft 1120 and the windingshaft 1140, and the sheet S is transported from the delivery shaft 1120to the winding shaft 1140 along a transport path Sc hung in theabove-described way. The printer 1000 is configured to record (form) animage on the sheet S by discharging a functional liquid onto the sheet Stransported along the transport path Sc.

The printer 1000 is configured, as a schematic configuration, to includea delivery portion 1102 which delivers the sheet S from the deliveryshaft 1120, a process portion 1103 which records an image on the sheet Sdelivered from the delivery portion 1102, a laser scanner device 1007which cuts out the sheet S on which the image is recorded in the processportion 1103, and a winding portion 1104 which winds the sheet S on thewinding shaft 1140.

The delivery portion 1102 includes the delivery shaft 1120 winding anend of the sheet S thereon, and a driven roller 1121 winding the sheet Sextracted from the delivery shaft 1120 thereon.

In the process portion 1103, the sheet S delivered from the deliveryportion 1102 is supported by a platen drum 1130 as a support portion,and a recording head 1151 or the like disposed in a head unit 1115 whichis disposed along an outer circumferential surface of the platen drum1130 performs an appropriate process so as to record an image on thesheet S.

The platen drum 1130 is a circular drum which is rotatably supported bya support mechanism (not illustrated) centering on a drum shaft 1130 s,and winds the sheet S transported from the delivery portion 1102 to thewinding portion 1104 on a rear surface (a surface on an opposite side toa recording surface) side thereon. The platen drum 1130 is driven torotate in a transport direction Ds of the sheet S as a result ofreceiving friction force with the sheet S, and supports the sheet S fromthe rear surface side in a range Ra in the circumferential directionthereof. Here, the process portion 1103 is provided with driven rollers1133 and 1134 turning the sheet S on both sides of the winding portionto the platen drum 1130. Driven rollers 1121 and 1131 and a sensor Seare provided between the delivery shaft 1120 and the driven roller 1133,and driven rollers 1132 and 1141 are provided between the winding shaft1140 and the driven roller 1134.

The process portion 1103 includes a head unit 1115, and the head unit1115 is provided with four recording heads 1151 corresponding to yellow,cyan, magenta, and black. Each of the recording heads 1151 faces a frontsurface of the sheet S wound on the platen drum 1130 with a slightclearance (platen gap), and discharges a functional liquid of acorresponding color from nozzles in an ink jet method. The respectiverecording heads 1151 discharge functional liquids onto the sheet Stransported in the transport direction Ds, and thus a color image isformed on the front surface of the sheet S.

Here, as the functional liquids, ultraviolet (UV) ink (photocurable ink)which is cured when being irradiated with ultraviolet rays (light) isused. Thus, the head unit 1115 of the process portion 1103 is providedwith first UV sources 1161 (light irradiation portions) among theplurality of recording heads 1151 in order to temporarily cure the UVink and to fix the UV ink to the sheet S. A second UV source 1162 as acuring portion is provided on a downstream side of the transportdirection Ds with respect to the plurality of recording heads 1151 (headunit 1115).

The laser scanner device 1007 is provided to partially cut out the sheetS on which an image is recorded, or to divide the sheet S. Laser lightwhich is caused to oscillate by a laser oscillator 1401 of the laserscanner device 1007 is applied to the sheet S which is a processedobject via a first lens 1403 and a first mirror 1407 or a second mirror1409 of which positions or rotation positions (angles) are controlled bydrive devices 1402, 1406 and 1408 including the encoder 1 of the firstembodiment or the second embodiment. As mentioned above, an irradiationposition of laser light LA applied to the sheet S is controlled by therespective drive devices 1402, 1406 and 1408, and thus the laser lightLA can be applied to a desired position on the sheet S. In the sheet S,a portion thereof irradiated with the laser light LA is melted, and thusthe sheet S is partially cut out or divided.

The printer 1000 described above includes the encoder 1. According tothe printer 1000, the printer 1000 can perform a highly accurateoperation by using the encoder 1 which performs highly accuratecalibration.

As mentioned above, the encoder, the robot, and the printer according tothe preferred embodiments of the invention have been described, but theinvention is not limited thereto, and a configuration of each portionmay be replaced with any configuration having the same function. Anyother constituent element may be added thereto. The configurations ofthe above-described two or more embodiments may be combined with eachother.

In the embodiments, a description has been made of a case where theencoder according to the embodiments of the invention is applied to arotary encoder, but this is only an example, and the encoder accordingto the embodiments may be applied to a linear encoder. In this case, thescale portion is provided to be relatively movable with respect to thebase portion, and a plurality of marks are disposed along a movementdirection thereof. The estimation portion performs template matching ona captured image in the imaging element by using a reference image, soas to detect a position of the mark, and estimates a movement state ofthe scale portion with respect to the base portion. The movement statemay include, for example, a movement distance, a movement speed, or amovement direction.

Here, calibration in a linear encoder may be performed in the samemanner as in the above-described embodiment. In other words, a pluralityof marks include a first mark and a second mark, and the estimationportion counts the number of pixels of the imaging element correspondingto a movement amount of the scale portion with respect to the baseportion until a position of the second mark is detected from detectionof a position of the first mark, and performs calibration on the basisof the counted number of pixels and the movement amount. The first markand the second mark are located at positions which are different fromeach other, and a relative position (distance) is required to be known.

The encoder according to the embodiments of the invention may be appliedto any type such as an absolute type and an incremental type.

In the embodiments, a description has been made of an exemplaryconfiguration in which the base of the robot is a “base portion (firstmember)”, and the first arm is a “rotation portion (second member)”, butthis is only an example, and one of any two members which are relativelyrotated may be a “base portion”, and the other member is a “rotationportion”. A location where the encoder is provided is not limited to ajoint between the base and the first arm, and may be a joint between anytwo arms which are relatively rotated. A location where the encoder isprovided is not limited to a joint of the robot.

In the above-described embodiments, the number of arms of the robot isone, but the number of arms of the robot is not limited thereto, and maybe, for example, two or more. In other words, the robot according to theembodiments of the invention may be, for example, a robot with two armsor a robot with a plurality of arms.

In the embodiments, the number of arms of the robot is two or six, butthe number of arms of the robot is not limited thereto, and may be, forexample, one, or three or more and five or less, or seven or more.

In the above-described embodiments, a location where the robot accordingto the embodiments of the invention is provided is not limited to afloor surface, and may be, for example, a ceiling surface or a sidewallsurface, and may be a moving object such as an automatic guided vehicle(AGV). The robot according to the embodiments of the invention is notlimited to being provided to be fixed to a structure such as a building,and may be, for example, a leg type walking (traveling) robot havinglegs.

The encoder according to the embodiments of the invention is not limitedto the above-described printer, and may be used for various printerssuch as an industrial printer and a consumer printer, having a rotationportion. In a case where the encoder according to the embodiments of theinvention is used for a printer, a location where the encoder isprovided is not limited to the above-described locations, and may beused for a paper feeding mechanism, and a movement mechanism of acarriage mounted with an ink head of an ink jet printer, for example.

The entire disclosure of Japanese Patent Application No. 2017-205416,filed Oct. 24, 2017 is expressly incorporated by reference herein.

What is claimed is:
 1. A robot comprising: a first member; a secondmember rotatably connected to the first member, a plurality of marksbeing provided on a surface of the second member, the plurality of marksincluding a first mark and a second mark; a decelerator configured todeliver drive force to the second member from the first member; an imagesensor disposed in the first member, the image sensor being configuredto capture the plurality of marks on the surface of the second member; amemory configured to store a program and first and second referenceimages corresponding to the first mark and the second mark,respectively; and a processor configured to execute the program so asto: continuously cause the image sensor to capture images of theplurality of marks by comparing each of the captured images with thefirst reference image when the second member rotates relative to thefirst member; identify a first location of the first mark in theplurality of marks when the captured image matches with the firstreference image; continuously cause the image sensor to capture imagesof the plurality of marks by comparing each of the captured images withthe second reference image when the second member rotates relative tothe first member; identify a second location of the second mark in theplurality of marks when the captured image matches with the secondreference image; count a number of pixels in the captured images thatare located at positions between the first location of the first markand the second location of the second mark; determine a physicalquantity amount corresponding to the counted number of pixels; andperform calibration of the robot in response to the determined physicalquantity amount.
 2. The robot according to claim 1, wherein the memoryis configured to store an absolute position or an absolute angle of atleast one of the first mark and the second mark with respect to thefirst member.
 3. A robot comprising: a first member; a second memberrotatably connected to the first member, a plurality of marks beingprovided on a surface of the second member, the plurality of marksincluding a first mark; a decelerator configured to deliver drive forceto the second member from the first member; an image sensor disposed inthe first member, the image sensor being configured to capture theplurality of marks on the surface of the second member; a memoryconfigured to store a program and a first reference image correspondingto the first mark; and a processor configured to execute the program soas to: continuously cause the image sensor to capture images of theplurality of marks by comparing each of the captured images with thefirst reference image when the second member rotates relative to thefirst member; identify a first location of the first mark in theplurality of marks when the captured image matches with the firstreference image at a first time; continuously cause the image sensor tocapture images of the plurality of marks by comparing each of thecaptured images with the first reference image when the second memberrotates relative to the first member by 360° after the identification ofthe first location of the first mark; identify a first location of thefirst mark in the plurality of marks when the captured image matcheswith the first reference image at a first time; count a number of pixelsin the captured images that are located at positions between the firstlocation of the first mark and the second location of the first mark;determine a physical quantity amount corresponding to the counted numberof pixels; and perform calibration of the robot in response to thedetermined physical quantity amount and the rotation angle of 360°. 4.The robot according to claim 3, wherein the memory is configured tostore an absolute position or an absolute angle of the first mark withrespect to the first member.
 5. A printer comprising: a platenconfigured to transfer a printing medium; a head configured to record animage on the printing medium; and an optical device having: a lightsource configured to emit light toward the printing medium; a firstmember; a second member, the second member rotating relative to thefirst member, a plurality of marks being provided on a surface of thesecond member, the plurality of marks including a first mark and asecond mark; a decelerator configured to deliver drive force to thesecond member from the first member; an image sensor disposed in thefirst member, the image sensor being configured to capture the pluralityof marks on the surface of the second member; a memory configured tostore a program and first and second reference images corresponding tothe first mark and the second mark, respectively; and a processorconfigured to execute the program so as to: continuously cause the imagesensor to capture images of the plurality of marks by comparing each ofthe captured images with the first reference image when the secondmember rotates relative to the first member; identify a first locationof the first mark in the plurality of marks when the captured imagematches with the first reference image: continuously cause the imagesensor to capture images of the plurality of marks by comparing each ofthe captured images with the second reference image when the secondmember rotates relative to the first member; identify a second locationof the second mark in the plurality of marks when the captured imagematches with the second reference image; count a number of pixels in thecaptured images that are located at positions between the first locationof the first mark and the second location of the second mark; determinea physical quantity amount corresponding to the counted number ofpixels; and perform calibration of the optical device in response to thedetermined physical quantity amount.
 6. The printer according to 5,wherein the memory is configured to store an absolute position or anabsolute angle of at least one of the first mark and the second markwith respect to the first member.